package com.koron.standard.jobStock.repair.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.koron.standard.jobStock.repair.bean.po.RepairItemParams;
import com.koron.standard.jobStock.repair.mapper.RepairItemParamsMapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 计划检修标准下工作项目-参数(RepairItemParams)表服务实现类
 *
 * @author jzp
 * @since 2021-09-16
 */
@Service
public class RepairItemParamsService extends ServiceImpl<RepairItemParamsMapper, RepairItemParams> {

    public void removeByRepairId(String repairId) {
        LambdaQueryWrapper<RepairItemParams> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(RepairItemParams::getRepairId, repairId);
        List<RepairItemParams> list = list(wrapper);
        removeByIds(list.stream().map(RepairItemParams::getId).collect(Collectors.toList()));
    }

}
